import request from "@/utils/request";
import qs from "qs";

// 查询油站员工信息列表
export function listPersonnel(query) {
  return request({
    url: "/system/user/listUser",
    method: "get",
    params: query,
  });
}
// 设备管理员工信息列表
export function listPersonnel2(query) {
  return request({
    url: "/system/user/list/listEmployee",
    method: "get",
    params: query,
  });
}

// 新查询油站员工信息列表
export function listQuery(query) {
  return request({
    url: "/staff/query",
    method: "get",
    params: query,
  });
}

// 新查询油站员工信息列表
export function listEnterpriseUser(query) {
  return request({
    url: "/system/user/listEnterpriseUser",
    method: "get",
    params: query,
  });
}

// 查询油站员工信息详细
export function getAllGunByStationId(stationId) {
  return request({
    url: "/stationOillGun/info/oilGun/" + stationId,
    method: "get",
  });
}

// 查询油站员工信息详细
export function getPersonnel(personnelId) {
  return request({
    url: "/station/personnel/" + personnelId,
    method: "get",
  });
}

// 新增油站员工信息
export function addPersonnel(data) {
  return request({
    url: "/station/personnel",
    method: "post",
    data: data,
  });
}

// 修改油站员工信息
export function updatePersonnel(data) {
  return request({
    url: "/system/user/editUser",
    method: "put",
    data: data,
  });
}

// 删除油站员工信息
export function delPersonnel(personnelId) {
  return request({
    url: "/station/personnel/" + personnelId,
    method: "delete",
  });
}

// 导出油站员工信息
export function exportPersonnel(query) {
  return request({
    url: "/station/personnel/export",
    method: "get",
    params: query,
  });
}

// 新员工列表
export function getStaffQuery(query) {
  return request({
    url: "/staff/query",
    method: "get",
    params: query,
  });
}

// 新删除员工
export function staffDeleteAll(params) {
  return request({
    url: "/staff/delete",
    method: "delete",
    params,
    paramsSerializer: (params) => {
      return qs.stringify(params, { indices: false });
    },
  });
}

// 新- 新增员工
export function staffAdd(data) {
  return request({
    url: "/staff/insert",
    method: "post",
    data: data,
  });
}

// 新更新员工
export function staffUpdate(data) {
  return request({
    url: "/staff/update",
    method: "post",
    data: data,
  });
}

// 查询员工详情
export function staffGetById(params) {
  return request({
    url: "/staff/getById",
    method: "get",
    params,
    paramsSerializer: (params) => {
      return qs.stringify(params, { indices: false });
    },
  });
}

// 查询油站下枪号列表
export function getStaffQueryGunList(query) {
  return request({
    url: "/staff/queryGunList",
    method: "get",
    params: query,
  });
}

//
export function selectEnterpriseAppid(query) {
  return request({
    url: "/enterprise/info/selectEnterpriseAppid",
    method: "post",
    params: query,
  });
}
// 获取员工码订单统计分页列表
export function getPayOrderEmployee(query) {
  return request({
    url: "/station/order/payOrderEmployee",
    method: "get",
    params: query,
  });
}
// 员工收款明细统计
export function getPayOrderStatistics(query) {
  return request({
    url: "/station/order/payOrderEmployee/statistics",
    method: "get",
    params: query,
  });
}
// 员工收款明细
export function getPayOrderDetail(query) {
  return request({
    url: "/station/order/payOrderDetail",
    method: "get",
    params: query,
  });
}
// 获取员工动态推荐码
export function getEmployeeQrApi(query) {
  return request({
    url: "staff/invite/getQrCode",
    method: "get",
    params: query,
  });
}
// 查询推荐列表信息
export function getInviteListApi(query) {
  return request({
    url: "staff/invite/list",
    method: "get",
    params: query,
  });
}
// 推荐详情列表信息
export function getInviteDetailApi(query) {
  return request({
    url: "staff/invite/detail/list",
    method: "get",
    params: query,
  });
}
// 导出推荐列表信息
export function getExportApi(query) {
  return request({
    url: "staff/invite/export",
    method: "get",
    params: query,
  });
}
